import cv2
import numpy as np

# 读取图片
image = cv2.imread('ro-25-result.jpg')

# 将图片转换为HSV颜色空间
hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)

# 调整亮度，增加或减少的值可以根据需要设定
value = 20  # 可以是正数（增加亮度）或负数（减少亮度）
v_channel = hsv[:, :, 2]
hsv[:, :, 2] = cv2.add(v_channel, value)

# 将HSV图片转换回BGR颜色空间
image_with_brightness_adjusted = cv2.cvtColor(hsv, cv2.COLOR_HSV2BGR)

# 显示图片
cv2.imshow('Original Image', image)
cv2.imshow('Brightness Adjusted Image', image_with_brightness_adjusted)
cv2.waitKey(0)
cv2.destroyAllWindows()